package com.tionsy.springbootshiro.repository;

import com.tionsy.springbootshiro.entity.UserEntity;
import com.tionsy.springbootshiro.entity.UserRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author tiany
 * @date 2018/10/30 16:58
 */
@Mapper
public interface UserMapper {
    UserEntity getUserByUsername(String username);

    UserEntity getUserById(String userId);

    int insertUser(UserEntity userEntity);

    List<UserEntity> getAllUser(@Param("username")String username, @Param("email")String email, @Param("phoneNumber")String phoneNumber);

    int updateUser(UserEntity userEntity);

    int deleteUserByIds(List<String> ids);

    int insertUserRoles(List<UserRoleEntity> list);

    int deleteUserRolesByUserIds(String[] ids);

    int batchInsert(List<UserEntity> userEntities);
}

